import {request} from "@/network/request";

//获取所有角色信息 不包括权限
export function getAllRoleSimple(){
    return request({
        url: '/admin/role/listSimple',
        method: 'get',
    })
}
//获取所有角色信息 包括权限
export function getAllRole(type,data){
    return request({
        url: '/admin/role/list',
        method: 'get',
        params:{type,data}
    })
}
//添加角色
export function addRole(RoleInfo){
    return request({
        url: '/admin/role/add',
        method: 'post',
        data:RoleInfo
    })
}
//修改角色
export function updateRole(RoleInfo){
    return request({
        url: '/admin/role/update',
        method: 'post',
        data:RoleInfo
    })
}
//角色权限修改
export function grantRolePermissionByRoleId(permissionIds,roleId){
    return request({
        url: '/admin/role/grantPermission/'+roleId,
        method: 'post',
        data:permissionIds
    })
}
export function deleteRoleById(roleId){
    return request({
        url: '/admin/role/deleteRoleById',
        method: 'get',
        params:{roleId}
    })
}